﻿namespace Simple.Services.System.FileInfo.Models
{
    public class FileInfoModel : ModelBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 文件夹Id
        /// </summary>
        public Guid? FolderId { get; set; }

        /// <summary>
        /// 是否文件夹
        /// </summary>
        public bool IsFolder { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        public string FileName { get; set; } = string.Empty;

        /// <summary>
        /// 文件大小
        /// </summary>
        public string? FileSize { get; set; }

        /// <summary>
        /// 文件后缀
        /// </summary>
        public string Filesuffix { get; set; } = string.Empty;

        /// <summary>
        /// 存储路径
        /// </summary>
        public string FilePath { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }

        /// <summary>
        /// 创建用户Id
        /// </summary>
        public Guid? CreatedUserId { get; set; }

        /// <summary>
        /// 创建用户名
        /// </summary>
        public string CreatedUserName { get; set; } = string.Empty;

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<SysFileInfo, FileInfoModel>();

            profile.CreateMap<FileInfoModel, SysFileInfo>()
                .ForMember(d => d.Id, options => options.Ignore());
        }
    }
}
